home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / ucrasm27.zip / SHELL.ASM < prev    next >
Assembly Source File  |  1993-04-01  |  2KB  |  82 lines

  1.         .xlist
  2.         include     stdlib.a
  3.         includelib    stdlib.lib
  4.         .list
  5.  
  6. ; Global variables go here:
  7.  
  8. dseg        segment    para public 'data'
  9. dseg        ends
  10.  
  11.  
  12.  
  13. cseg        segment    para public 'code'
  14.         assume    cs:cseg, ds:dseg
  15.  
  16. ;
  17. ; Variables that wind up being used by the standard library routines.
  18. ; The MemInit routine uses "PSP" and "zzzzzzseg" labels.  They must be
  19. ; present if you intend to use getenv, MemInit, malloc, and free.
  20. ;
  21. ;
  22.         public    PSP
  23. PSP        dw    ?
  24. ;
  25.         mmm    "Hello",cr,lf,0
  26. ;
  27. ;
  28. ;--------------------------------------------
  29. ; Here is a good place to put other routines:
  30. ;
  31. ;
  32. ;
  33. ;
  34. ;-----------------------------------------------------------------
  35. ; Main is the main program.  Program execution always begins here.
  36. ;
  37. Main        proc
  38.         mov    cs:PSP, es        ;Save pgm seg prefix
  39.         mov    ax, seg dseg        ;Set up the segment registers
  40.         mov    ds, ax
  41.         mov    es, ax
  42. ;
  43.         mov    dx, 0
  44.         meminit
  45.         jnc    GoodMemInit
  46.  
  47.         print
  48.         db    "Error initializing memory manager",cr,lf,0
  49.         jmp    Quit
  50. GoodMemInit:
  51.  
  52. ;***************************************************************************
  53. ;
  54. ; Put your main program here.
  55. ;
  56. ;***************************************************************************
  57.  
  58.  
  59.  
  60.  
  61.  
  62. Quit:        ExitPgm
  63. Main        endp
  64.  
  65. cseg            ends
  66.  
  67.  
  68.  
  69. ; Allocate a reasonable amount of space for the stack (2k).
  70.  
  71. sseg        segment    para stack 'stack'
  72. stk        db    256 dup ("stack   ")
  73. sseg        ends
  74.  
  75.  
  76. ; zzzzzzseg must be the last segment that gets loaded into memory!
  77.  
  78. zzzzzzseg    segment    para public 'zzzzzz'
  79. LastBytes    db    16 dup (?)
  80. zzzzzzseg    ends
  81.         end    Main
  82.